home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d2 / wsortho1.arc / IMDISP.DOC < prev    next >
Text File  |  1991-06-13  |  68KB  |  1,515 lines

  1.  
  2.  
  3.  
  4.  
  5.                      PLANETARY DATA SYSTEM
  6.  
  7.           USER'S GUIDE FOR THE PDS IMDISP PROGRAM
  8.  
  9.                          INTRODUCTION
  10.  
  11.      This  document describes the IMDISP program, an  interactive 
  12. image  display utility for the IBM Personal Computer family  (PC, 
  13. XT  and AT) and compatibles. It has been developed for  use  with 
  14. the  Compact  Disk  - Read-Only Memory  (CDROM)  storage  systems 
  15. currently being evaluated by the Planetary Data System (PDS).  It 
  16. can  also  be  used to display images stored on  floppy  or  hard 
  17. disks.
  18.  
  19.      This  User's Guide presents an overview of image  processing 
  20. and  CDROM fundamentals, a section on the installation of  IMDISP 
  21. and CDROM software and hardware, a description of IMDISP  program 
  22. operation,  a description of other utility programs which can  be 
  23. used in conjunction with IMDISP, and a command summary.
  24.  
  25.      Other  support  software for using the PDS CDROM  disks  has 
  26. also  been developed. These packages include the  USGS  Planetary 
  27. Image Cartography System (PICS) for Microvax computers, a set  of 
  28. FORTRAN routines to access CDROM disks on VAX computers  (VMSCD), 
  29. and "C" language source code to process disks written in the High 
  30. Sierra  format. Contact Mike Martin (JPLPDS::MMARTIN) for  access 
  31. to these tools.
  32.  
  33.                            Chapter 2
  34.  
  35.                           BACKGROUND
  36.  
  37.  
  38.      Efforts  to utilize small computer systems for  display  and 
  39. analysis  of  scientific data have been hampered by the  lack  of 
  40. sufficient  data  storage  capacity to  accommodate  large  image 
  41. arrays.  Most  planetary images  require  nearly  a  megabyte  of 
  42. storage. Over the past two years a new storage technology "CDROM" 
  43. has been developed which provides the capability to store  up  to 
  44. 600  megabytes of data on a single 4.72-inch disk. The disks  can 
  45. be  mass  produced,  and  hundreds of  copies  of  large  digital 
  46. archives distributed rather than the few sets currently produced. 
  47. Readers for CDROM disks can now be purchased for under a thousand 
  48. dollars   for  use  on  personal  computers  and   some   science 
  49. workstations.
  50.  
  51.      The  PDS  has  worked with  industry  and  other  government 
  52. agencies  to  support the development of CDROM as  a  major  data 
  53. distribution  and storage media for space science  data.  Initial 
  54.  
  55. development  efforts by the PDS, the Voyager Project, and  multi-
  56. disciplinary   science  representatives  have  resulted   in  the 
  57. production of 5 CDROM disks, two samplers, and 3 disks containing
  58. all 6,538 images from  the Voyager  Uranus encounter.  The IMDISP 
  59. program can be  used to display  most  of these  data  files on a 
  60. personal computer equipped with a CDROM drive.
  61.  
  62. 2.1 DIGITAL IMAGE PROCESSING SUMMARY
  63.  
  64.      A digital image is a picture converted to numerical form  so 
  65. that  it  can  be stored and used in a  computer.  The  image  is 
  66. divided  into a matrix of small regions called picture  elements, 
  67. or pixels. The rows and columns of pixels are called "lines"  and 
  68. "samples", respectively. Each pixel has a numerical value, or  DN 
  69. (data number)  value,  quantifying the darkness  or brightness of 
  70.   
  71. the image at that spot. In total, each pixel has an address (line 
  72. number,  sample  number) and a  DN value, which is all  that  the 
  73. computer needs for processing. The DN value of each pixel usually 
  74. represents  a shade of darkness or brightness between  black  and 
  75. white  (gray levels). How many gray levels there are in an  image 
  76. depends  on  the  number of bits used  to  represent  each  pixel 
  77. intensity  in  the computer. The number of gray  levels  will  be 
  78. equal to 2^n, where n is the number of bits per pixel's DN value. 
  79. If 8 bits are used to represent a pixel's DN value (gray  level), 
  80. the  system will be capable of using 2^8, or 256, gray levels  in 
  81. an image, where DN 0 is pure black, and DN 255 is pure white. If 
  82. each DN used only 4 bits of storage, the image would contain only 
  83. 2^4 or 16 gray levels; if there were only 1 bit per DN, the image 
  84. would contain only black and white pixels (bit values of 0 or 1).
  85.  
  86. 2.2 OVERVIEW OF IMDISP CAPABILITIES
  87.  
  88.      While  the  specifics of IMDISP commands  are  discussed  in 
  89. Chapter 4, this section provides a general overview of how a user 
  90. can manipulate images once a file is selected. There are  DISPLAY 
  91. commands which allow the user to display all or part of an  image 
  92. at  various  positions on the display screen. The user  may  also 
  93. zoom in and out from a point on the image defined by the  cursor, 
  94. and may pan around the image. The cursor may be turned on or off; 
  95. when  on, the arrow keys are used to move the cursor  around  the 
  96. screen; when off, the cursor is not visible.
  97.  
  98.      A  user may choose to "subsample" the image, to enable  more 
  99. or  all  of the original image to be displayed on the  screen  at 
  100. once. For example, if the image were subsampled by a factor of 2, 
  101. every  other  pixel  from every other line  would  be  displayed, 
  102. starting from the upper left corner of the image. If a factor  of 
  103. 3  were chosen, every third pixel from every third line would  be 
  104. displayed. Any positive integer may be used for subsampling.
  105.  
  106.      The user may produce a histogram of an image file, which  is 
  107. a  graph showing the number of pixels per DN value, or per  range 
  108. of  DN values, for the entire image. Histograms are  overlaid  on 
  109. top  of the image, but may be removed using the REFRESH  command. 
  110. Subsampling may be specified when computing a histogram to reduce 
  111. the time required for the calculations.
  112.  
  113.      A  profile may be created which plots DN value versus  pixel 
  114. along a line between two points on the image. After the cursor is 
  115. used to select the two endpoints, the connecting line is drawn on 
  116. the image and the profile is plotted at the bottom of the screen.
  117.  
  118.      The user may also "stretch" the image, which is analogous to 
  119. turning the contrast knob on a TV set. The user specifies low and 
  120. high  DN values; all pixels with values lower than the  specified 
  121. "low"  become  black, and  all pixels higher than  the  specified 
  122. "high"  value become white. All pixels between the low  and  high 
  123. values are evenly shaded between black and white.
  124.  
  125.      There  are bookkeeping types of commands, also. These  allow 
  126. the  user to do such things as retrieve a desired image from  the 
  127. CD-ROM,  to  save an image to a file on hard disk, and  to  erase 
  128. only the graphics from the screen or to erase the entire  screen. 
  129. Users  may  execute batch command files to do a series  of  tasks 
  130. automatically.  Lastly, the user may, of course, EXIT the  IMDISP 
  131. program when done.
  132.  
  133. 2.3 GRAY LEVEL AND FALSE COLOR IMAGES
  134.  
  135.      Most  planetary  images  are composed  of  8-bit  DN  values 
  136. representing monochrome brightness levels in the scene. To obtain 
  137. color  images,  separate images are taken through  color  filters 
  138. (red,  green,  blue) and are then combined by  ground  processing 
  139. systems to produce a true color image. Only a very small fraction 
  140. of planetary images are available in color versions. Most display 
  141. and analysis is done on monochrome images.
  142.  
  143.      A display with 256 (2^8) gray levels is required to  present 
  144. the information contained in a standard image. However, the human 
  145. eye  can  only distinguish about 32 gray levels.  Thus  5-bit  DN 
  146. values  would satisfy most display  requirements.  Unfortunately, 
  147. computers  are  oriented to the storage of  and  manipulation  of 
  148. items  which are a power of two, and 5-bit pixels would  be  very 
  149. clumsy. The display devices which the IMDISP program supports are 
  150. limited  to 16 gray levels (PGA), 4 gray levels (EGA) or  2  gray 
  151. levels  (CGA).  The  16 gray levels of the PGA  are  adequate  to 
  152. support   image  analysis;  however  4  or  2  gray  levels   are 
  153. practically useless for viewing planetary images. Fortunately the 
  154. EGA display will support 16 different colors, and a color palette 
  155. can  be  selected  which  uses a graduated  scale  of  colors  to 
  156. represent  gray  levels, producing a "false color"  image  (false 
  157. because  the displayed color does not represent the actual  color 
  158. of the scene).
  159.  
  160.      A  false color image (also called a pseudo color  image)  is 
  161. created from a black and white image by assigning a color (rather 
  162. than a gray level) to each DN value in the image. For instance, a 
  163. DN  value  of 128 could be reassigned to yellow if  the  user  so 
  164. desired.  Ranges of DNs (e.g., 100-125) may also be assigned  one 
  165. color. Pseudo colors get assigned to DN values in a pseudo  color 
  166. table,  which the display program then uses to determine  how  to 
  167. color  the  image  on the monitor. Display  programs  often  have 
  168. preset   pseudo   color  tables  with  commonly   used   DN-color 
  169. combinations, and the user can simply call for one of these  when 
  170. generating  a pseudo color image. The option exists,  of  course, 
  171. for  users  to  generate their own pseudo  color  tables.  Pseudo 
  172. colors are often used to highlight features of an unusual  nature 
  173. in an image.
  174.  
  175.      Since  the Enhanced Graphic Adapter for the IBM PC  provides 
  176. only 4 gray shades (black, dark gray, light gray and white)  most 
  177. image viewing is done using a pseudo color table which interprets 
  178. gray  levels  as color values ranging from  black  through  reds, 
  179. greens and blues up to white.
  180.  
  181. 2.4 RADIOMETRIC AND GEOMETRIC CORRECTIONS
  182.  
  183.      All  camera systems have some kind of distortions  in  the 
  184. lens,  in  the  way the shutter works, etc.  Distortions  in  the 
  185. amount  of  fight transferred through the camera to  the  imaging 
  186. plate  are called radiometric distortions.  Geometric  distortion 
  187. affects  the "squareness" of an image, and is detected by  taking 
  188. an image of a geometric grid.
  189.  
  190.      For  spacecraft  cameras, both types of  distortion  can  be 
  191. measured  before  launch, and in a limited  fashion,  in  flight. 
  192. These measured distortions are saved in digital files. When a raw 
  193. image is received, these "calibration files," as they are called, 
  194. are  subtracted  from  (or  otherwise  applied  to)  the   image, 
  195. effectively  removing radiometric and geometric distortion.  This 
  196. process is called radiometric and geometric correction. Corrected 
  197. images  contain the closest possible representation of the  scene 
  198. being imaged.
  199.  
  200. 2.5 IMAGE FILE FORMATS
  201.  
  202.      Digital  image files are seldom stored as a simple array  of 
  203. pixels.  Generally there is an area at the beginning of an  image 
  204. file containing descriptive information about the image. This  is 
  205. referred to as a label or header area. Figure 2-1 shows a diagram 
  206. of a simple image format with a label area followed by the  image 
  207. lines.  In practice, images from planetary missions have  a  more 
  208. complicated   format,  due  to  the  need  to  store   additional 
  209. information  to  allow proper interpretation of the  image  data. 
  210. Figure  2-2  shows  the  format of a  Voyager  image,  which  has 
  211. engineering parameters embedded at the end of each image line  to 
  212. form a line suffix area, an engineering trailer record after  the 
  213. last image line, and this is followed by an image histogram.
  214.  
  215.  
  216.                  --------------------------      
  217.                 |  Labels or Header Area   |    
  218.                 |--------------------------|     
  219.                 |  Image Array Line 1      |    
  220.                 |--------------------------|    
  221.                 |  Image Array Line 2      |
  222.                 |--------------------------|
  223.                              .
  224.                              .
  225.                              .
  226.                  --------------------------
  227.                 |  Image Array Line n      |
  228.                  --------------------------
  229.  
  230.             Figure 2-1: Simple Image Format
  231.  
  232.      Different image label formats have been developed for use by 
  233. nearly  all image processing facilities. Two formats  are  widely 
  234. used  within the planetary and astronomy communities: the  VICAR2 
  235. (Video  Image  Communication and Retrieval) labels  used  by  the 
  236. Multi-Mission   Image  Processing  Laboratory  (MIPL)  and   FITS 
  237. (Flexible  Image  Transport)  labels  used  for  astronomy  image 
  238. interchange.  The PDS has developed a label scheme which is  very 
  239. similar  to  these  standards,  called  the  Object   Description 
  240. Language  (ODL). This format attempts to add a broader  range  of 
  241. data  descriptive capabilities to the proven capabilities of  the 
  242. existing label systems. A description of the ODL architecture  is 
  243. given in Appendix D.
  244.  
  245.      Most of the images stored on the PDS CDROM disks have either 
  246. ODL  or VICAR2 labels. IMDISP will automatically interpret  these 
  247. labels to determine the display format of the image data.
  248.  
  249.                  --------------------------------------      
  250.                 |  PDS ODL Labels                      |    
  251.                 |--------------------------------------|     
  252.                 |  Image Array Line 1    | Line Suffix |    
  253.                 |--------------------------------------|    
  254.                 |  Image Array Line 2    | Line Suffix |    
  255.                 |--------------------------------------|    
  256.                                   .
  257.                                   . 
  258.                                   .
  259.                  ---------------------------------------
  260.                 |  Image Array Line 800  | Line Suffix |    
  261.                 |--------------------------------------|    
  262.                 |  Image Engineering Trailer           |
  263.                 |--------------------------------------|
  264.                 |  Image Histogram                     |
  265.                  --------------------------------------
  266.  
  267.             Figure 2-2: Voyager CDROM Image Format
  268.  
  269. 2.6 CDROM FUNDAMENTALS
  270.  
  271.  (note:  this short section has been deleted to save file space
  272. when transmitting the sample 1000 X 1000 digital orthophoto.  CD-
  273. ROM doesn't directly related to that sample)
  274.  
  275.  
  276.                             Chapter 3
  277.  
  278.                        IMDISP INSTALLATION
  279.  
  280.  
  281.      IMDISP requires an IBM PC, XT, AT or 100 percent  compatible 
  282. with  512K of base memory. It supports several  graphics  display 
  283. devices,  including  the  Enhanced Graphics  Adapter  (EGA),  the
  284. Video Graphics  Array  (VGA), the Professional  Graphics  Adapter 
  285.  
  286. (PGA),  and  the  Color  Graphics  Adapter  (CGA).  The  hardware 
  287. environment  in which  the program  has been developed and tested 
  288. includes and  AT class computer,  deluxe or  enhanced  EGA  board 
  289. with 256K of memory, and multisync or multiscan monitor.
  290.  
  291. 3.1 PROGRAM SETUP
  292.  
  293.      The IMDISP program can be run from a floppy or hard disk. To 
  294. use  the program from a floppy disk, insert the program  disk  in 
  295. the  A: or B: drive and type the MSDOS command: "A:" or  "B:"  to 
  296. set the floppy disk as the default drive. To use the program from 
  297. hard disk first create a directory to hold the IMDISP files.  Use 
  298. the  MSDOS command "MKDIR \IMDISP" to create a directory to  hold 
  299. the programs. Use the "CHDIR \IMDISP" command to make IMDISP  the 
  300. default directory. Insert the distribution floppy disk in  floppy 
  301. disk  drive A:. Now type "COPY A:*.*" to copy the files from  the 
  302. distribution  disk to your hard disk. You should now be  able  to 
  303. run  all examples from that directory on your hard disk.  If  you 
  304. wish  to use IMDISP from other directories, you need  to  include 
  305. the  IMDISP directory in your MSDOS "PATH" command. This  command 
  306. provides MSDOS with a list of directories to search when  looking 
  307. for  a  program  file  to run. If you wish  to  run  IMDISP  from 
  308. different  directories, the \IMDISP subdirectory should be  added 
  309. to  the  PATH command in your AUTOEXEC.BAT file.  A  sample  path 
  310. command would look like this:
  311.  
  312.     PATH=C:\DOS;C:\UTIL;C:\WORDSTAR;C:\IMDISP
  313.  
  314.      The  sample  batch  files and special  pointer  label  files 
  315. included  on the distribution disk will only run if your  current 
  316. default directory is \IMDISP.
  317.  
  318.      You  may want to add a line to your AUTOEXEC.BAT file  which 
  319. will  allow you to abort the display program while running  batch 
  320. files or displaying large image files. If the command  "BREAK=ON" 
  321. is  placed  in  CONFIG.SYS,  you  will  (sometimes)  be  able  to 
  322. terminate the IMDISP program by typing the control and break keys 
  323. simultaneously. Different computer systems offer varying response 
  324. to  the  control-break command, and the use of this  command  may 
  325. effect other programs you use.
  326.  
  327. 3.2 CDROM SETUP
  328.  
  329. (This section also deleted; see section 2.6 above)
  330.  
  331. 3.3 DISPLAY DEVICE CHARACTERISTICS
  332.  
  333.      IMDISP  automatically  finds out which display  devices  are 
  334. available  (PGA,  EGA, or CGA) and uses the  one  available.  The 
  335. Enhanced  Graphics Adapter must have at least 128K of  memory  to 
  336. work  properly. Use of the Color Graphics Adapter is  discouraged 
  337. because the pixels have no gray levels, only black or white.
  338.  
  339.      The  display  coordinates start at (1,1) in the  upper  left 
  340. corner  of the screen; the line direction is down and the  sample 
  341. direction is to the right.
  342.  
  343. 3.3.1 Enhanced Graphics Adapter (EGA)
  344.  
  345.      The   EGA  is  a  bit-mapped  display  device  providing   a 
  346. resolution  of  350  lines  by 640 samples  of  4-bits  each.  It 
  347. produces  a  digital video signal for each  primary  color  (red, 
  348. green  and blue), The video signal for each color can be  set  to 
  349. one  of four levels, roughly equivalent to off, low,  medium  and 
  350. high.  Thus the number of possible colors (color palette)  is  64 
  351. (4^3). The following table illustrates the colors created by some 
  352. of the different combinations of red, green and blue.
  353.  
  354.   Red=   off, Green=   off, Blue=   off   results in Black
  355.   Red=   low, Green=   off, Blue=   off   results in Dark Red
  356.   Red=medium, Green=   off, Blue=   off   results in Light Red
  357.   Red=  high, Green=   off, Blue=   off   results in Bright Red
  358.   Red=   low, Green=   low, Blue=   low   results in Dark Gray
  359.   Red=medium, Green=   low, Blue=   off   results in Brown
  360.   Red=medium, Green=medium, Blue=   off   results in Yellow
  361.   Red=medium, Green=medium, Blue=medium   results in Light Gray
  362.   Red=  high, Green=   low, Blue=   off   results in Orange
  363.   Red=  high, Green=  high, Blue=  high   results in White
  364.  
  365.          Table 3-1: Sample EGA Color Palette Settings
  366.  
  367.  
  368.      The  EGA display is limited to only 16 colors out of the  64 
  369. possible, because only 4-bits are used to store each pixel  value 
  370. in memory. This 4-bit pixel value points to an entry in the color 
  371. table  which  represents one of the 64 possible  combinations  of 
  372. red, green and blue which can be displayed.
  373.  
  374.      Many  of  the  newer EGA boards are  capable  of  displaying 
  375. additional lines and samples when using a Multisync or  Multiscan 
  376. monitor.  The  standard  EGA uses a  16  Mhz  crystal  oscillator 
  377. (something like a clock which regulates the display speed), which 
  378. limits  the video output rate to the equivalent of 640 pixels  by 
  379. 350  lines.  The  EGA  circuitry  allows  for  a  faster  crystal 
  380. oscillator to be added to the board (24 Mhz and beyond)  allowing 
  381. about 25 percent more lines to be displayed (480 lines instead of 
  382. 350).  A  method for adding this capability to  an  existing  EGA 
  383. board  (for  about  $10  worth of  parts)  is  described  in  the 
  384. September 16, 1986 issue of PC Magazine.
  385.  
  386.      This mode requires that a multisync or multiscan monitor  be 
  387. attached to the computer, and there is no way for the program  to 
  388. automatically  detect  the  presence  of  the  special   monitor. 
  389. Therefore  this  display mode is invoked by specifying  an  MSDOS 
  390. "ENVIRONMENT"  variable. This is done by issuing an  MSDOS  "SET" 
  391. command at the MSDOS prompt as follows:
  392.  
  393.     SET IMDISP=EGA480
  394.  
  395.      This command can also be put in your AUTOEXEC.BAT file using 
  396. a  text editor, so that you need not invoke it each time you  run 
  397. IMDISP.   It  should  have  no  effect  on  other  MSDOS   system 
  398. operations.  There  is a chance that adding  this  variable  will 
  399. exceed  the size reserved by MSDOS for environment variables.  If 
  400. so,  you  should  consult  your  MSDOS  manual  to  increase  the 
  401. environment size on your system. The environment variable can  be 
  402. removed with the MSDOS command:
  403.  
  404.     SET IMDISP=
  405.  
  406.      Where a carriage return is typed immediately after the equal 
  407. sign. The 480 line mode requires an additional 83K of memory  for 
  408. the refresh buffer. If you try this mode and receive the  message 
  409. "Insufficient memory for line buffer", it is probably because you 
  410. have  a  512K memory machine, or have  memory  resident  programs 
  411. operating (like Sidekick or Superkey) which reduce the  available 
  412. memory to less than about 400K. You will need to use the 350 line 
  413. mode  or remove some memory resident programs to operate  in  480 
  414. line mode.
  415.  
  416.      Users  of the EGA with Multisync and Multiscan monitors  can 
  417. achieve  a  16 gray level display through the use  of  a  special 
  418. device  called the Grayscaler EP, from Avocado Computer, Box 1655, 
  419. Wheaton, Md., 20915, (301) 593-5586. This cable converts  the 
  420. digital  video  signals  produced  by the  EGA  board  to  analog 
  421. signals.  By selecting appropriate EGA palette entries, a  fairly 
  422. good  representation of 16 gray levels can be achieved  (use  the 
  423. palette selection "PAL LOAD GRAY16.PAL" to select this palette).
  424.  
  425. 3.3.2 Video Graphics Array (VGA)
  426.  
  427. This version (4.0) of the IMDISP program includes support for the 
  428. IBM Video Graphics Array (VGA) display device.  The VGA  produces 
  429. an  analog display with several new color modes.   Of  particular 
  430. interest  to  IMDISP users are the 640 x 480 line  mode  with  16 
  431. displayable  colors (or gray levels).  The  320 x 200  line  mode 
  432. with 256 displayable  colors (or 64 gray levels) has  been tested
  433. but produces very blocky pixels.  This version of IMDISP supports 
  434. the 640 x 480 mode.  
  435.  
  436. To  set  the VGA display mode you must set  a  MSDOS  environment 
  437. variable prior to executing IMDISP.
  438.  
  439. To set the environment variable use the MSDOS command:
  440.  
  441. SET IMDISP=VGA
  442.  
  443. This will put the display in 640 sample by 480 line mode, with 16 
  444. gray  levels or colors displayable from a palette of  256K.   The 
  445. display  is  initialized  with  a  gray  scale  palette,  but   a 
  446. pseudocolor  palette can be invoked with the IMDISP command  "PAL 
  447. PS 0".  The "PALETTE EDIT" command will allow you to step forward 
  448. or  backward  through the 64 available shades  for  each  primary 
  449. color.   See  the  next  section  of  the  IMDISP manual for more 
  450. information on the palette edit function.  
  451.  
  452.  
  453. Users who  wish to experiment with the 320 x 200 VGA mode may use
  454.  
  455. SET IMDISP=VGA320
  456.  
  457. but be warned that all text messages expect an 80  column screen,
  458. and therefore wrap-around  on the display  creating a mess.  This 
  459. mode  is only provided for  experimentation and is not for casual 
  460. users!!!
  461.  
  462. 3.3.3 Professional Graphics Adapter (PGA)
  463.  
  464.      The PGA is a special graphics board developed by IBM for use 
  465. with CAD/CAM applications on the IBM PC. Because its architecture 
  466. is incompatible with the CGA and EGA boards, it has not been well 
  467. received by software developers. The PGA provides an analog video 
  468. signal  with a display resolution of 480 lines by 640 samples  of 
  469. 8-bits  each. It provides 16 intensities for each primary  color, 
  470. resulting  in a palette of 4,096 colors (16^3). The  color  table 
  471. allows 256 colors to be displayed simultaneously, however only 16 
  472. gray levels can be selected. 
  473.  
  474. Use the command:
  475.  
  476. SET IMDISP=PGA 
  477.  
  478. at the MSDOS prompt to force IMDISP to go into PGA display mode.
  479.  
  480. 3.3.4 Color Graphics Adapter (CGA)
  481.  
  482.      The  CGA  display  is a bit-mapped graphics  device  with  a 
  483. resolution of 200 lines by 640 samples of 1-bit each. It supports 
  484. only 2 colors in this display mode, black and white. This display 
  485. can  be used to get a general idea of the contents of  a  digital 
  486. image,  or for displaying one bit images (graphics  for  example) 
  487. but is not recommended for use with the PDS CDROM images.
  488.  
  489. To force a multi-function display card into CGA mode, use:
  490.  
  491. SET IMDISP=CGA
  492.  
  493.  
  494.                           Chapter 4
  495.  
  496.                        IMDISP OPERATION
  497.  
  498.      IMDISP can be used to display images up to several  thousand 
  499. lines and samples with a variety of pixel formats. These  formats 
  500. include  bit (1 bit), nibble (4 bits), byte (8 bits), or  integer 
  501. (16  bits). Integer pixels are assumed to be byte-swapped,  which 
  502. means  that  the  sign and most significant 7 bits  are  in  the 
  503. rightmost  byte,  and  the least significant 8 bits  are  in  the 
  504. leftmost byte. This is the convention used by both the IBM PC and 
  505. VAX  computer hardware families. IBM mainframes and 68000  series 
  506. computers  (Macintosh and Sun, for example)  use  un-byte-swapped 
  507. integers.
  508.  
  509.      Program  interaction with the user is via commands typed  in 
  510. response to the "COMMAND:" prompt. Most interaction is  performed 
  511. on  the graphic display screen, and program messages are  printed 
  512. over  any  image  display currently on the  screen.  The  REFRESH 
  513. command can be used to restore an image after other commands have 
  514. written  text over the display. The ERASE command can be used  to 
  515. clear  away  the  clutter left by  program  status  messages  and 
  516. previously  displayed  images. The screen  is  not  automatically 
  517. erased after each operation in order that multiple images can  be 
  518. displayed simultaneously, or so a histogram can be placed on  the 
  519. screen with the image.
  520.  
  521.      IMDISP  is invoked by typing "IMDISP" or "IMDISP  filename", 
  522. where  filename  is the name of an image file to  be  opened  for 
  523. processing  at program start-up. The filename may include a  disk 
  524. drive and path name specification.
  525.  
  526.      The  program  will blank the display screen  and  display  a 
  527. welcome logo, then the prompt "COMMAND:" will appear in the lower 
  528. left  portion  of the screen. If a filename is  included  in  the 
  529. command invocation, the welcome message is not displayed and  the 
  530. screen will display the COMMAND: prompt.
  531.  
  532.      Typing  "HELP" at the command prompt will provide a list  of 
  533. IMDISP commands. The most frequently used commands are "FILE"  to 
  534. open  a  file for processing, and "DISPLAY" to display  an  image 
  535. once the file has been opened.
  536.  
  537. 4.1 COMMAND SYNTAX
  538.  
  539.      The command line syntax is of the form:
  540.  
  541.      COMMAND KEYWORD1 = VALUE1 KEYWORD2=VALUE2 KEYWORD3 VALUE3 .
  542. . .
  543.  
  544.      The command line may be typed in either upper or lower case. 
  545. The  command  and  the  keyword names may  be  abbreviated  to  3 
  546. characters  in most cases. Any number of spaces may  be  inserted 
  547. between  words, and the keyword and value may be separated  by  a 
  548. space  or an equals sign. Some keywords do not require  a  value. 
  549. All  keywords are optional and have default values.  
  550.  
  551. 4.2  COMMAND DESCRIPTION
  552.  
  553.      Table  4-1 presents a summary of IMDISP commands.  They  are 
  554. separated  into  3 groups, file  manipulation  commands;  display 
  555. commands  and  program  control commands.  Only  the  capitalized 
  556. letters are required to specify a command.
  557.  
  558. 4.3 OPERATING MODES
  559.  
  560.      Several  of  the commands invoke special  program  operating 
  561. modes.  These  include  the FILE command when  issued  without  a 
  562. filename  argument  and  the CURSOR,  PROFILE  and  PALETTE  EDIT 
  563. commands.  The FILE mode displays a list of files in the  current 
  564. directory  on the screen for selection. It also contains  several 
  565. subcommands  for  controlling the display of files  on  the  menu 
  566. screen.  In  the CURSOR, PROFILE and PALETTE  EDIT  commands  the 
  567. cursor  keys  (arrow  keys) on the numeric  keypad  are  used  in 
  568. conjunction  with other keys to control program operation.  These 
  569. modes  are  exited  by typing either a  period  '.'  or  carriage 
  570. return.
  571.  
  572. File oriented commands:
  573.  
  574.        CD               . . . . to change the default directory
  575.        DIRECTORY        . . . . to perform the MSDOS directory
  576. command
  577.        FILE             . . . . to specify the name of the image
  578.        SAVE             . . . . to save the image display to a file
  579.        TYPE             . . . . to perform the MSDOS type command
  580.        LABEL            . . . . to display the image labels
  581.  
  582. Display commands:
  583.  
  584.        BROWSE           . . . . to display a group of images
  585.        DISPLAY          . . . . to display the image
  586.        ERASE            . . . . to erase the display
  587.        OVERLAY          . . . . to place an overlay on the image
  588.        REFRESH          . . . . to refresh the image plane
  589.        PALETTE          . . . . to adjust the palette for the
  590. display
  591.        HISTOGRAM        . . . . to display the histogram of the
  592. image
  593.        SET              . . . . to set DN value range
  594.        STRETCH          . . . . to do a linear gray scale stretch
  595.        CURSOR           . . . . to move the cursor around
  596.        PROFILE          . . . . to plot a profile of the image
  597.        TEXT             . . . . to draw text on the image
  598.  
  599. Program control commands:
  600.  
  601.        BATCH            . . . . to execute a batch command file
  602.        MENU             . . . . to select images from a menu file
  603.        EXIT or QUIT     . . . . to exit from the program
  604.        HELP             . . . . display help information
  605.        SYSTEM           . . . . execute MSDOS commands
  606.  
  607.                  Table 4-1: IMDISP Command Summary
  608.  
  609. 4.4 ERROR HANDLING
  610.  
  611.      If  an invalid command is issued at the COMMAND: prompt  the 
  612. program will beep and return to the COMMAND: prompt. In  handling 
  613. command  parameters the program takes action on those  parameters 
  614. that are recognized, but ignores invalid parameters. For example, 
  615. issuing a "SET LO = 25 HI = 100" command will not have any effect 
  616. since  the proper parameter names for the SET command are  "DNLO" 
  617. and "DNHI".
  618.  
  619.      It  is  also  possible  for  certain  system  errors  to  be 
  620. encountered  which  cause  the  program  to  abort  leaving  your 
  621. computer  in  graphics mode. N you are  using  certain  utilities 
  622. which reset the default text mode screen colors (like the  Norton 
  623. Utilities  screen attributes command) you may not be able to  see 
  624. what is being printed on the screen. The simplest approach is  to 
  625. perform  a  warm  boot,  by  typing  the  Ctrl,  Alt,  Del   keys 
  626. simultaneously. Alternately, you can often type IMDISP then  EXIT 
  627. to  reset the computer to text mode. Errors in  processing  image 
  628. files on CDROM, hard disk or floppy disks can cause these aborts.
  629.  
  630. 4.5 COMMAND REFERENCE
  631.  
  632.      This  section lists all IMDISP commands  alphabetically  and 
  633. describes  their  function,  parameters  which  control   command 
  634. operation,  and provides examples of command use, In the  command 
  635. and parameter description the following conventions are used:
  636.  
  637.   filename    represents the name of an MSDOS file, and may include
  638.  
  639.               an optional drive identifier and path specification.
  640.  
  641.   n           represents an integer value.
  642.  
  643. 4.5.1 BATCH
  644.  
  645.      The  BATCH command reads commands from the  specified  batch 
  646. command file. If no file name is specified the current  directory 
  647. is  searched for a file named BATCH.CMD. The CURSOR, PROFILE  and 
  648. PALETTE  EDIT  commands should not be used within  batch  command 
  649. files since they require interactive inputs from the keyboard.
  650.  
  651.      The BATCH command may take the following argument:
  652.  
  653.    filename    filename of batch command file.
  654.  
  655.      A  batch  file is simply a text file containing  a  list  of 
  656. commands,  with each command terminated by a carriage return.  If 
  657. the  command file is created with a word processor,  the  program 
  658. should be used in the non-document mode, to assure that  carriage 
  659. returns  are  embedded  between  command  lines.  An  example  of 
  660. creating a batch file to display the PDS logo image follows.
  661.  
  662.      At the MSDOS command level type:
  663.  
  664.      COPY CON TEST.CMD 
  665.      FILE LOGO.IMG
  666.      DISP ZOOM 4 
  667.      DISP ZOOM 2
  668.      DISP 
  669.      DISP SUB 2
  670.      EXIT
  671.  
  672.      Now  run IMDISP and type"BATCH TEST.CMD" at  the  "COMMAND:" 
  673. prompt.  Make  sure  the  file  "LOGO.IMG"  is  in  your  current 
  674. directory.  The  PDS logo should be displayed on  the  screen  in 
  675. several different sizes.
  676.  
  677. 4.5.3 BROWSE
  678.  
  679.      The BROWSE command  will  display all images  in a directory
  680. one after another.  An optional directory mask can be supplied to
  681. display only selected files ("BROWSE *.IMG"). The command creates
  682. a list  of files  to be  displayed, then  creates and  executes a 
  683. batch command file to display those images.  After  each image is 
  684. displayed, the  filename is displayed at the top of the image.  A 
  685. BROWSE  session can be  interrupted by pressing  control-s,  then 
  686. restarted by pressing control-q TWICE. A session can be halted by 
  687. typing any other key during the display. It can then be restarted 
  688. (from the beginning) with the command  "BROWSE C:BATCH.CMD".  The 
  689.  
  690. default  file  name  for  the batch  file  created  by the BROWSE 
  691. command is 'C:BATCH.CMD'.  This  name  can be  changed using  the 
  692. "SET BROWSE fname" command  where  fname can  consist  of a drive 
  693.  
  694. letter  and  filename,  which  should  be  terminated   with  the 
  695. extension ".CMD".
  696.  
  697. The BROWSE command has one argument and several optional keywords.
  698.  
  699.       fname   optional file selection mask (must immediately 
  700.               follow the command BROWSE).  May include a drive
  701.               letter but not a subdirectory name. Examples (*.img, 
  702.               L:*.BRS).
  703.  
  704.       SIZe n  allows the display of multiple images on the 
  705.               screen.  For example, on a 640 x 480 VGA display, 
  706.               six 200 x 200 images can be displayed adjacent to 
  707.               each other.
  708.  
  709.       SUBsample n used in conjunction with the SIZE command, to 
  710.               scale each image to fit in the SIZE specification.
  711.  
  712.       NOLabel inhibits writing the file name label at the top of 
  713.               each image as it is displayed.
  714.  
  715. As an example, the command "BROWSE *.* SIZE 200 SUBSAMPLE 4" will 
  716. display all the files in the current directory, subsampling  each
  717. by 4 and displaying  them  in  a 200 x 200  window.  The  command 
  718. "BROWSE *.BRS SIZE 100 SUB 2"  when used  with the Voyager Uranus
  719. browse images (on  Volume 3 of the  Uranus CDROM collection) will
  720. display up to 24 images at a time on the screen.
  721.  
  722. *** NOTE ***
  723.  
  724. BROWSE does  not  distinguish  between image and non-image files,
  725. and it is up to the  user  to  provide  the appropriate directory
  726. mask to select ONLY images.  If a message  "Image  does  not have 
  727. proper  label"  comes  up  on  the  screen  during  BROWSE, it is 
  728. probably  because  a  non-image  file is in the directory you are 
  729. browsing.  You  can  type  carriage  returns several times to get 
  730. back to the "COMMAND:" prompt, and the browse will continue.
  731.  
  732. If  you  are  using BROWSE on a computer without a hard disk, you 
  733. will have  to  use  the SET BROWSE command to  change the default 
  734. browse file name to a writable disk drive, for example: 
  735. "SET BROWSE A:BROWSE.CMD". If you are using BROWSE to view  files 
  736. on  a  CDROM  disk,  be  sure to  include the  drive letter  of a 
  737.  
  738. writable  disk   drive if  you  specify  a BROWSE file name.  The
  739. BROWSE command file  produced by the BROWSE command can be edited
  740. with a text editor to produce your own custom command files.
  741.  
  742. 4.5.3 CD or CHDIR
  743.  
  744.      The  CD or CHDIR command is used just as it is at the  MSDOS 
  745. command level to change the current default directory.
  746.  
  747.      The   argument   of  the  CD  command  is  the   path   name 
  748. specification  of  the new default directory.  For  example,  "CD 
  749. \IMDISP\IMAGES"  would make \IMDISP\IMAGES the current  directory 
  750. if  it  exists.  To  change the current  default  drive  use  the 
  751. "SYSTEM"  command  ("SYSTEM  L:"   for  example)  or  the  "FILE" 
  752. command.  If there is not enough memory available for the  system 
  753. command to be executed an error message is displayed.
  754.  
  755. 4.5.4 CURSOR
  756.  
  757.      The CURSOR command is used to select a point in a  displayed 
  758. image  for  subsequent display commands. When first  invoked,  it 
  759. places  a  small  cursor  symbol at the  center  of  the  screen. 
  760. Depending  on the current contents of the screen, the cursor  may 
  761. be  hard  to see. Moving it with the arrow keys  on  the  numeric 
  762. keypad will help you locate it.
  763.  
  764.      Whenever  the cursor is moved, the current line  and  sample 
  765. location  of  the cursor and the DN value of the  pixel  at  that 
  766. point  is printed in the lower right portion of the  screen.  The 
  767. cursor  will move 16 pixels in the selected direction unless  the 
  768. movement value is adjusted using the + or  keys.
  769.  
  770.                         Numeric Keypad Keys
  771.                    -------------------------------
  772.                   |   7   |   8   |   9   | PrtSc |
  773.                   |  Home |  Up   |  PgUp |       |
  774.                    -------------------------------
  775.                   |   4   |   5   |   6   |   -   |
  776.                   |  Left |       | Right |       |
  777.                    ------------------------------- 
  778.                   |   1   |   2   |   3   |   +   |
  779.                   |  End  | Down  |  PgDn |       |
  780.                    -------------------------------
  781.  
  782.                       Action of Keypad Keys:
  783.  
  784.                       7 = Move up and left.
  785.                       8 = Move up.
  786.                       9 = Move up and right.
  787.                       4 = Move left.
  788.                       5 = Not active.
  789.                       6 = Move right.
  790.                       1 = Move down and left.
  791.                       2 = Move down.
  792.                       3 = Move down and right.
  793.                       - = Decrement cursor movement value.
  794.                       + = Increment cursor movement value.
  795.  
  796.  
  797.              Table 4-2: IMDISP Cursor Keys
  798.  
  799.      Cursor  mode is exited by typing a "." (period) or  carriage 
  800. return. The cursor position is retained for future use in DISPLAY 
  801. commands  which  use the CENTER option. It is  very  useful  with 
  802. large  images where the entire image may be displayed  using  the 
  803. subsample option, then a point selected for subsequent display at 
  804. full resolution.
  805.  
  806.      Example:  Type  "FILE  MONTAGE.IMG" followed  by  "DISP"  to 
  807. display  the  MONTAGE.IMG file.  Type "CUR" to enter  the  cursor 
  808. mode,  then move the cursor to the center of the Uranus image  in 
  809. the  upper left corner of the image using the up and  left  arrow 
  810. keys.  Now type "." to exit cursor mode, then type "DISP  ZOOM  4 
  811. CENTER"  which will display Uranus as a large grainy ball on  the 
  812. screen.
  813.  
  814. 4.5.5 DIR
  815.  
  816.      The  DIR command is used just as the MSDOS dir command.  Its 
  817. argument  is  passed to MSDOS for execution. At the  end  of  the 
  818. directory  listing the screen will display "Type carriage  return 
  819. to  continue:" which will return to the IMDISP command  mode.  If 
  820. there is not enough memory available for the system command to be 
  821. executed an error message is displayed.
  822.  
  823. 4.5.6 DISPLAY
  824.  
  825.      The  DISPLAY command reads an image file and displays it  on 
  826. the  the screen. If the image is larger than the display  screen, 
  827. the default mode is to display as much of the upper left  portion 
  828. of the image as will fit on the screen. The SUBSAMPLE keyword  can 
  829. be   used  to  select  every  'n'  lines  and  samples  so   that 
  830. representations  of very large images may be displayed. The  ZOOM 
  831. keyword  can  be  used to enlarge a portion of an  image  on  the 
  832. display screen. Keywords can be specified to begin displaying  at 
  833. any line and sample in the image with the SL (starting line)  and 
  834. SS  (starting  sample).  If only a limited number  of  lines  and 
  835. samples  are  to  be displayed the NL (number of  lines)  and  NS 
  836. (number of samples) keywords can be used. The UP, DOWN, LEFT  and 
  837. RIGHT  keywords can be used to display different portions of  the 
  838. image,  relative to the currently displayed portion. The  display 
  839. can also placed at any point on the screen using the DSL (display 
  840. starting line) and DSS (display starting sample) keywords.
  841.  
  842.      DISPLAY takes the following keywords :
  843.  
  844.       SUBsample n  a positive integral subsampling factor for
  845.                    displaying images larger than the size of the 
  846.                    screen.  SUB=2 would display an image at half 
  847.                    the resolution.  
  848.   
  849.       If the image lines and samples look like this:
  850.  
  851.                                   sample values 
  852.  
  853.                 line 1            1  2  3  4  5 
  854.                 line 2            6  7  8  9 10
  855.                 line 3           11 12 13 14 15    
  856.  
  857.       Then the command DISP SUB 2 would produce:
  858.  
  859.                                   sample values
  860.  
  861.                 line 1            1  3  5 
  862.                 line 2           11 13 15    
  863.  
  864.       ZOOM n        a positive integral zoom factor for looking at
  865.                     part of an image close up.  The zoom command 
  866.                     replicates pixels by the integer value
  867. specified.  
  868.                     If the image lines and samples look like this:
  869.  
  870.                                   sample values
  871.  
  872.                 line 1            1  2  3  
  873.                 line 2            4  5  6
  874.                 line 3            7  8  9
  875.  
  876.       Then the command ``zoom 2" would produce the following:
  877.  
  878.                                   sample values 
  879.  
  880.                 line 1            1  1  2  2  3  3  
  881.                 line 2            1  1  2  2  3  3  
  882.                 line 3            4  4  5  5  6  6  
  883.                 line 4            4  4  5  5  6  6
  884.                 line 5            7  7  8  8  9  9
  885.                 line 6            7  7  8  8  9  9
  886.  
  887.  
  888.       CENTER     center the display around current cursor position.
  889.  
  890.                  This command is very useful when displaying large 
  891.                  images or when zooming in on selected areas. 
  892.       NL n
  893.       NS n       number of lines or samples from the image file to
  894. display
  895.  
  896.       SL n
  897.       SS n       starting line or sample within the image file to
  898. display
  899.  
  900.       UP n
  901.       DOWN n     adjusts the starting line up or down from the 
  902.                  previous value, thereby moving the display window 
  903.                  up or down in the image.  The default amount to 
  904.                  move up or down is the size of the display.
  905.  
  906.       LEFT n
  907.       RIGHT n    adjusts the starting sample left or right from the
  908.  
  909.                  previous value, thereby moving the display window 
  910.                  left or right in the image
  911.         
  912.       DSL n
  913.       DSS n      start the image display at the specified line and 
  914.                  sample on the display screen.
  915.  
  916.      Examples: The user wants to display an entire Voyager  image 
  917. (800  x 800) on the display screen then display a portion of  the 
  918. image  at full resolution. Type "FILE MIRANDA1.LBL",  then  "DISP 
  919. SUB  2" to display the entire image at half resolution,  Use  the 
  920. CURSOR  command  to move the cursor to the center of an  area  of 
  921. interest.  Exit  the cursor mode by typing ".", then  type  "DISP 
  922. CENT"  to  display  the selected portion of  the  image  at  full 
  923. resolution.
  924.  
  925.      The  user wishes to place 2 images which are each 800  lines 
  926. by  800 samples on the screen next to each other. The first  file 
  927. is opened with "FILE IMAGE1.IMG".  The "DISPLAY SUB 4" command is 
  928. given to display every 4th line and sample of the image to create 
  929. a 200 x 200 display. Next the "FILE IMAGE2.IMG" command is given. 
  930. Now a "DISPLAY SUB 4 DSS 201" is given to place the second  image 
  931. on  the screen starting at display sample position 201,  next  to 
  932. the first image.
  933.  
  934. 4.5.7 ERASE
  935.  
  936.      The command ERASE causes the screen to be erased by  setting 
  937. all  of  the  pixels to 0, which may  not  necessarily  be  black 
  938. depending on the palette setting. 
  939.  
  940. 4.5.8 EXIT
  941.  
  942.      The  EXIT command exits IMDISP and returns the user  to  the 
  943. MSDOS  operating  system. The contents of the image  display  and 
  944. refresh buffer are discarded.
  945.  
  946. 4.5.9 FILE
  947.  
  948.      FILE does not take a keyword, just a value which is the file 
  949. name.  The  specified file will be opened, or  an  error  message 
  950. issued  if the file cannot be opened. The capability to  directly 
  951. address  any sector on the CDROM disk by providing  its  physical 
  952. address  (minute, second and sector number) is also available  to 
  953. users of the Microsoft Extensions software.
  954.  
  955.      If  the  FILE command is specified without a  filename,  the 
  956. program  will  display  a  list of  file  names  in  the  current 
  957. directory.  Each  file name is preceded by a number.  Typing  the 
  958. number  associated  with a file name will select  that  file  for 
  959. processing.  File  names  that  actually  represent  lower  level 
  960. directories  are  indicated  with a <d> symbol  after  the  name, 
  961. Directories  can  be traversed downward by selecting  the  number 
  962. associated  with  a  directory  name.  Upward  traversal  is   by 
  963. selecting  the  item  identified as PARENT DIR.  This  will  move 
  964. upward in the directory hierarchy.
  965.  
  966.      The  prompt  mode clears the screen and displays a  menu  of 
  967. files  and commands. These commands allows specification  of  the 
  968. default  drive, a file "mask" to use in selecting file names  for 
  969. display and options for moving through the list of files when the 
  970. current directory contain more than 30 files. The top line of the 
  971. display  also  indicates  how  many  files  are  in  the  current 
  972. directory.  After  exiting  the FILE prompt  mode,  the  previous 
  973. contents  of  the  display  screen can  be  recovered  by  typing 
  974. "REFRESH".
  975.  
  976.      The FILE prompt mode subcommands:
  977.  
  978.          D       select default disk drive
  979.          M       specify a file selection mask to use in displaying
  980.  
  981.                  files on the screen.
  982.          N       display the next set of file names on the screen 
  983.                  if there are more files in the current directory 
  984.                  than can be displayed on one screen.
  985.          P       display the previous set of file names.
  986.          Q       quit the file selection mode and return to IMDISP 
  987.                  command mode.
  988.  
  989.      The  N, P and Q commands are executed immediately. If the  D 
  990. or M commands are selected, the user is prompted to enter a drive 
  991. letter or file mask.
  992.  
  993.      If  the file selected by the "FILE filename" or FILE  prompt 
  994. mode has a valid label, either PDS or VICAR2, then the number  of 
  995. lines  and samples and the pixel size will be displayed.  If  the 
  996. file  is unlabeled then the program will prompt for the values  to 
  997. use  for the number of lines and samples, the number of bits  per 
  998. pixel,  and  the  number of header bytes.  PDS  detached  labeled 
  999. images  can  also be displayed. The specified  file  remains  the 
  1000. current file until a new FILE command is given. The FILE  command 
  1001. resets  the  SET  DNLO and SET DNHI values  to  the  minimum  and 
  1002. maximum  for the pixel size (normally 0 and 255). If a  specified 
  1003. filename  is  not found in the current directory  then  an  error 
  1004. message is displayed.
  1005.  
  1006.      If  the  unlabeled  image has a regular format,  that  is  a 
  1007. uniform  structure of repeating lines and samples, the  user  can 
  1008. specify  this  information  when prompted  by  the  program.  For 
  1009. example,  an  image named ASTERIA.DAT with one 1422  byte  header 
  1010. block  followed by an image composed of 370 lines by 450  samples 
  1011. of 8 bit pixels would be processed as follows:
  1012.  
  1013. At  the COMMAND: prompt type "FILE ASTERIA.DAT" The program  will 
  1014. display the message:
  1015.  
  1016.     Input file does not have a proper label.
  1017.     Input number of lines: 370                enter the value 370
  1018.     Input number of samples: 450              enter the value 450
  1019.     Input size of each sample: 8              enter the value 8
  1020.     Input size of header label: 1422          enter 1422 for the 
  1021.                                               size of the foreign 
  1022.                                               label block).
  1023.  
  1024.      The  COPIM  utility can be used to add a PDS  label  to  the 
  1025. beginning  of  such a file, so that it can be  used  subsequently 
  1026. without having to specify all the parameters separately.
  1027.  
  1028.      The  physical address of a data block on the CDROM can  also 
  1029. be  specified using the syntax 'FILE "CD:mm:ss:bb"', where mm  is 
  1030. the minute, ss the second, and bb the sector block number of  the 
  1031. beginning  of the desired data area. The CD:mm:ss:nn must  be  in 
  1032. double quotes and the CD must be capitalized! This mechanism  can 
  1033. be  used  to access files on non-High Sierra format  disks.  This 
  1034. will  only  work  on  systems  using  the  Microsoft   Extensions 
  1035. software.
  1036.  
  1037. 4.5.10 HELP
  1038.  
  1039.  
  1040.      HELP  displays the online help message. If followed  by  the 
  1041. name  of  a  valid  command  the  message  for  that  command  is 
  1042. displayed.  HELP is not provided for MSDOS commands (DIR,  CHDIR, 
  1043. CD and TYPE).
  1044.  
  1045. 4.5.11 HISTOGRAM
  1046.  
  1047.  
  1048.      The HISTOGRAM command produces a plot showing the number  of 
  1049. pixel  values  in  the image at each DN level. The  range  of  DN 
  1050. values  is displayed on the x-axis and the number of  occurrences 
  1051. of a specific DN value on the y-axis (See Figure 4-1).
  1052.  
  1053.      The  HISTOGRAM command reads through the  image,  calculates 
  1054. the  histogram,  and then displays the plot on  the  screen.  The 
  1055. histogram is scaled so that the third highest histogram value  is 
  1056. used  as  the maximum. It is recommended that  the  SUBSAMPLE  or 
  1057. other   subsetting  keywords  be  used  to  speed  up   histogram 
  1058. calculation,  which  can be quite slow for large images  and  for 
  1059. images  stored on CDROM. Histogram plots are displayed on top  of 
  1060. any image currently displayed on the screen, so the user may wish 
  1061. to  use  the  ERASE command to clear the screen  prior  to  using 
  1062. HISTO.  After  the  histogram  is displayed,  the  image  can  be 
  1063. restored using the REFRESH command.
  1064.  
  1065.        27582  |            .
  1066.               |           .. 
  1067.               |          ....
  1068.     COUNT     |         .....
  1069.               |        .......
  1070.               |       .........
  1071.               |     ............
  1072.               |   ...............
  1073.               --+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
  1074.               0      64      128     192     256                
  1075.                           DN value
  1076.  
  1077.             Figure 4-1: Sample Image Histogram
  1078.  
  1079.  
  1080.      By  evaluating  the histogram, the user  can  determine  the 
  1081. optimum settings for the SET (DNLO and DNHI) command to produce a 
  1082. useful  display.  In  the  example  above,  the  image  data  are 
  1083. clustered  between  DN  values  32 and  144.  Using  the  default 
  1084. settings  of  the EGA display mode the colors assigned to  the  2 
  1085. lowest  color  values and the 7 highest values  (representing  DN 
  1086. values from 0 to 31 and from 144 to 255) would not be used  since 
  1087. the image contains no pixels with these values.
  1088.  
  1089.      By  using the "SET DNLO 32 DNHI 144" command the 16  display 
  1090. levels  available on the EGA display would be assigned to  values 
  1091. between 32 and 144 rather than distributed evenly from 0 to  255, 
  1092. and all 16 colors would be used in the display.
  1093.  
  1094.      HISTOGRAM takes the following keywords and arguments:
  1095.  
  1096.         SUBSAMPLE  n   a integral subsample  factor 
  1097.                        for speeding up histogram use of
  1098.                        "HISTOGRAM SUBSAMPLE 4" is always
  1099. recommended
  1100.         NL n
  1101.         NS n           number of lines and samples from image
  1102.         SL n
  1103.         SS n           starting line and sample in image
  1104.         CENT           perform the histogram on only the displayed
  1105.                        portion of the image.
  1106.  
  1107.      Two  special  keywords can be used with  Voyager  or  Viking 
  1108. images  on  the PDS CDROM disks.  These  will  extract  histogram 
  1109. values  stored  with the image on the CDROM disk and  reduce  the 
  1110. time required for the histogram to be generated from more than  1 
  1111. minute to about 3 seconds. Note that these commands will not work 
  1112. with Voyager image files in the \PLANET\JUPITER\ATMOS  directory, 
  1113. or with versions of system software written before April 1987.  
  1114.  
  1115.         VOY     use histogram from Voyager CDROM engineering data
  1116.         VIK     use histogram from Viking CDROM engineering data
  1117.  
  1118. 4.5.12 LABEL
  1119.  
  1120. The label command prints the labels for the currently selected
  1121. image file on the screen.  
  1122.  
  1123. 4.5.13 MENU
  1124.  
  1125. The menu command reads a file containing a list of file names and 
  1126. places the user in the MENU mode, where files from this list can
  1127. be 
  1128. selected for display.  The MENU mode is similar to the FILE mode, 
  1129. except that the list of files presented is that provided in the
  1130. menu 
  1131. file, rather than from a selected directory.
  1132.  
  1133. The MENU mode can be invoked by typing "MENU filename.MNU" at the 
  1134. COMMAND: prompt.  It can also be invoked on program startup by
  1135. typing 
  1136. "IMDISP filename.MNU" to initiate the program.  The menu file must
  1137. use the ".MNU" extension to startup IMDISP in MENU mode.
  1138.  
  1139. Subcommands of the MENU mode are as follows:
  1140.  
  1141. # - Enter the number corresponding to a desired file name to select
  1142. the file.
  1143.  
  1144. P)revious  - display the previous screen of file names
  1145. N)ext      - display the next screen of file names
  1146. Q)uit      - quit or exit from MENU mode
  1147.  
  1148. After selecting and displaying an image, the user can return to the
  1149.  
  1150. current menu by typing "MENU" at the COMMAND: prompt.
  1151.  
  1152. A menu file can take either of two formats.  The preferred format
  1153. is a 
  1154. PDS labelled table file containing file names.  A sample file is
  1155. shown
  1156. below:
  1157.  
  1158. NJPL1I00PDS100000000           = SFDU_LABEL
  1159. FILE_TYPE                      = TABLE
  1160. RECORD_FORMAT                  = STREAM
  1161. OBJECT                         = FILE_NAME
  1162.   TYPE                         = LITERAL
  1163.   LENGTH                       = 80
  1164. ENDOBJECT
  1165. NOTE                           = "Sample MENU file for IMDISP"
  1166. END
  1167. L:\OCEAN\SCBMEAN.IMG
  1168. L:\OCEAN\WCMEAN.IMG
  1169. L:\PLDS\TMCH01.DAT
  1170. L:\PLDS\DEM.DAT
  1171. L:\PLANET\SATURN\ATMOS\C3497355.IMG
  1172. <END OF FILE>
  1173.  
  1174. A  second  abbreviated  form  may  also  be  used, where only the 
  1175. filenames are specified in the  ".MNU"  file.  In  this  case the 
  1176. file  would  only  contain  the  filenames  shown  after  the END 
  1177. statement in the example above.  
  1178.  
  1179. 4.5.14 OVERLAY
  1180.  
  1181. The OVERLAY command draws a lat/lon overlay grid on the displayed 
  1182. image.  It is  intended only for use  with the Ocean Data System, 
  1183. West Coast Time Series CDROM in this program version.  
  1184.  
  1185. The OVERLAY command has the following arguments:
  1186.  
  1187.       MAXLAT      Latitude of top of image.
  1188.       MINLAT      Latitude of bottom of image. 
  1189.       MAXLON      Longitude of left side of image.
  1190.       MINLON      Longitude of right side of image.
  1191.  
  1192.       LEGend      Draw a color scale with the overlay.
  1193.  
  1194. 4.5.15 PALETTE
  1195.  
  1196.      The PALETTE command is used for changing the colors assigned 
  1197. to  displayable  color  values.  This is  done  by  modifying  an 
  1198. internal  color  table which assigns intensity  values  for  red, 
  1199. green  and  blue to a color value, The EGA provides  4  intensity 
  1200. values  for each of 3 colors, so that 64 different colors can  be 
  1201. created. However, the EGA pixels are only 4-bits each so only  16 
  1202. color values can be used simultaneously.
  1203.  
  1204.      The palette can be modified using the EDIT command and saved 
  1205. and  loaded from a disk file. The edit mode is invoked by  typing 
  1206. PALETTE EDIT. With the EGA display, a bar containing 16 colors or 
  1207. shades  will  be displayed on the bottom of the screen.  A  small 
  1208. square  will appear in the middle of the center color  box.  This 
  1209. indicates  that  this  color  value  is  currently  selected  for 
  1210. editing.  To  select another color value for  editing,  move  the 
  1211. small square to the appropriate color using the "4" (left  arrow) 
  1212. and  "6" (right arrow) keys on the numeric keypad. The  color  of 
  1213. the current color box is changed with the "R", "G", and "B"  keys 
  1214. (for  red,  green,  and blue). Upper case  letters  increase  the 
  1215. amount  of  the primary color, and lower case keys  decrease  the 
  1216. amount of the color. The "8" (up arrow) and "2" (down arrow) keys 
  1217. increase  and decrease, respectively, the amount of  red,  green, 
  1218. and  blue simultaneously. Other commands in the palette edit mode 
  1219. are the  "s" command,  which  will  shift all colors one value to 
  1220. the right, and the  "x" command, which will exchange color values 
  1221. (the color setting for color  0 becomes the setting for color 15, 
  1222. while 15  replaces  0, the  color setting for color 1 becomes the 
  1223. setting  for 14,  while 14  replaces  1, etc.).  The  up and down 
  1224. arrow keys can also be used to cycle through the colors available 
  1225. in  a  given  display  mode  one  at a time.  Type the "." key or 
  1226. carriage return to exit the edit mode.
  1227.  
  1228.      PALETTE takes the following keywords and arguments:
  1229.  
  1230.         EDIT n           to interactively adjust an n-color
  1231. palette. 
  1232.                          See edit description (above) for details
  1233.  
  1234.         PSEUDOCOLOR n    PS = 0 for default palette, 
  1235.                          PS = 1 for gray scale palette, 
  1236.                          PS = 2 for pseudo color palette
  1237.         SAVE filename    saves the specified palette on disk
  1238.         LOAD filename    loads the specified palette from disk
  1239.  
  1240.      The  default  palette file for LOAD or  SAVE  operations  is 
  1241. IMDISP.PAL.  The format of the default color palette when  stored 
  1242. in a palette file is as shown below:
  1243.  
  1244. NJPL1I00PDS000000784            = PDS_SFDU_LABEL
  1245. FILE_TYPE                       = TABLE
  1246. RECORD_TYPE                     = STREAM
  1247. FILE_RECORDS                    =  28
  1248. TABLE_ROWS                      =  16
  1249. ROW_COLUMNS                     =   4
  1250. COLUMN_NAME                     = (COLOR_NUMBER,
  1251.                                    RED_VALUE,
  1252.                                    GREEN_VALUE,
  1253.                                    BLUE_VALUE)
  1254. COLUMN_TYPE                     = (INTEGER,INTEGER,INTEGER,INTEGER)
  1255. END
  1256.    0   0   0   0
  1257.    1  64   0   0
  1258.    2 128   0   0
  1259.    3 192   0   0
  1260.    4 192  64   0
  1261.    5 192 128   0
  1262.    6 192 192   0
  1263.    7 128 192   0
  1264.    8   0 192   0
  1265.    9   0 192 128
  1266.   10   0 128 128
  1267.   11   0 128 192
  1268.   12   0   0 192
  1269.   13 128   0 192
  1270.   14 192   0 192
  1271.   15 192 192 192
  1272.  
  1273.      The  first  column of the palette table is the  color  value 
  1274. number  for  the display, and columns 2, 3 and  4  represent  the 
  1275. intensity  of  the  red, green and  blue  (respectively)  primary 
  1276. colors on a scale of 0 to 255. With the EGA display these  values 
  1277. are: 0 = off; 64 = low; 128 = medium; 192 = high.
  1278.  
  1279. 4.5.16 PROFILE
  1280.  
  1281.  
  1282.      PROFILE  plots the DN values of pixels located along a  line 
  1283. between  two points in the image, i.e. it creates a graph  of  DN 
  1284. value versus pixel along the line joining the two points,  Cursor 
  1285. mode is used to select the two endpoints; typing "." or  carriage 
  1286. return selects the current cursor position as the endpoint. After 
  1287. the endpoints are selected a line is drawn between the points and 
  1288. the graph is plotted at the bottom of the screen, showing the  DN 
  1289. values  on the x-axis and the positions along the line on the  y-
  1290. axis.
  1291.  
  1292. 4.5.17 QUIT
  1293.  
  1294.      Exits  the  program. The contents of the image  display  and 
  1295. refresh buffer are discarded.
  1296.  
  1297. 4.5.18 REFRESH
  1298.  
  1299.      REFRESH redisplays the image plane from the refresh  buffer. 
  1300. When  images are written to the screen they are also  written  to 
  1301. the  refresh buffer. The REFRESH command writes this buffer  back 
  1302. to  the screen, thereby erasing any graphics or  text  overlaying 
  1303. the  image  on the screen. The refresh buffer  contains  as  many 
  1304. lines  from  the display screen as there is room for  in  memory. 
  1305. REFRESH  takes,es  no parameters. It can also be used  after  the 
  1306. FILE prompt mode to redisplay the contents of the refresh buffer.
  1307.  
  1308.      Refresh is commonly used after the HELP command, or after  a 
  1309. HISTOGRAM  or PROFILE command to remove text and plots  from  the 
  1310. display screen.
  1311.  
  1312. 4.5.19 SAVE
  1313.  
  1314.      The SAVE command copies  the  contents of the display screen 
  1315. to a file.  On  EGA  systems  the  display  buffer  contains only 
  1316. 4-bits per  pixel, so  specifying  BP = 8  will  write  the 4-bit 
  1317. pixels in full bytes,  but does not save full 8-bit  pixels  even 
  1318. if the  input  image  is an 8-bit  image,  Use  the COPIM utility 
  1319. program to  produce  a  full resolution subset of an 8-bit image.
  1320.  
  1321.      SAVE  takes the following arguments and keywords, where  the 
  1322. filename must immediately follow the SAVE command:
  1323.  
  1324.         filename        filename of image to save
  1325.  
  1326.         NL n
  1327.         NS n            number of lines and samples to save
  1328.  
  1329.         SL n
  1330.         SS n            starting line and sample to save
  1331.         BP n            number of bits per pixel in output image
  1332.  
  1333.      Example: Save a 200 line by 200 sample area at the center of 
  1334. an  image  in the file SMALL.IMG. First use the FILE  command  to 
  1335. select and display an input image. Now type:
  1336.  
  1337.      "SAVE SMALL.IMG SL 100 SS 210 NL 200 NS 200" 
  1338.  
  1339. to save the portion of the image beginning at line 100 and sample 
  1340. 210 in the new file SMALL.IMG.
  1341.  
  1342. 4.5.20 SET
  1343.  
  1344.      SET is used to display and change the DN (pixel value) range 
  1345. that  is  used  to  compress  the  pixel  values  to  the   range 
  1346. appropriate  for the display device. The default, which is  reset 
  1347. for  each  new  file,  is the full range of  DN  values  for  the 
  1348. particular pixel format (e.g. 0 to 255 for byte). It is also used
  1349. to specify a file name to be used by the browse command.
  1350.  
  1351.      The results of a SET command will not take effect until  the 
  1352. next DISPLAY command is performed.
  1353.  
  1354.      Set takes the following keywords:
  1355.  
  1356.         DNLOW n
  1357.         DNHIGH n   where values less than DNlow are set to  color 
  1358.                    value 0, values greater than DNHIGH are set to 
  1359.                    the  maximum  color value available,  and  the 
  1360.                    color  values between are assigned equally  to 
  1361.                    the DN values between Dnlow and DNhi.
  1362.  
  1363.         BROwse filename sets a file name to be used for the
  1364.                    browse file.  This file name will override the
  1365.                    default file name, which is 'c:browse.cmd'.
  1366.  
  1367.      For  example,  using the default color palette  and  an  EGA 
  1368. display with 16 color values available, the command "SET DNLO 100 
  1369. DNHI 164" will assign DN values below 100 to black and DN  values 
  1370. above 164 to white, and spread the 16 color values between the DN 
  1371. limits, thus each color value will represent 4 DNs (value 0 =  DN 
  1372. 100 to 103; value 1 - DN 104 to 107, etc.).
  1373.  
  1374.      If  values other than the default are used then  the  images 
  1375. will display more slowly because scaling divisions are  required. 
  1376. SET with no parameters will display the current values.
  1377.  
  1378.      The  DNLO  and  DNHI values are reset  to  the  minimum  and 
  1379. maximum for a given pixel size when a FILE command is issued.
  1380.  
  1381. 4.5.21 STRETCH
  1382.  
  1383.  
  1384.      STRETCH  sets the palette to a gray scale stretched  between 
  1385. the two specified pixel values. Stretch is most useful on the PGA 
  1386. display  where 16 gray levels are available. On the  EGA  display 
  1387. the  stretch  command  activates the  gray  level  palette  which 
  1388. provides  only 4 gray levels. Use the PAL PS 0 command to  return 
  1389. the display to the default palette after performing a stretch.
  1390.  
  1391.      STRETCH takes the following keywords :
  1392.  
  1393.         LOW n
  1394.         HIGh n     the low and high DN values  of the stretch.   
  1395.                    
  1396.  
  1397.      These  pixel  values refer to the DN values in  the  current 
  1398. image display, not necessarily in the original image (scaling may 
  1399. have  been involved).   For example with the EGA display  the  DN 
  1400. values in the display range from 0 to 15, even if a byte image is 
  1401. being displayed.
  1402.  
  1403.      The STRETCH command is not recommended for use on EGA systems.
  1404.  
  1405. 4.5.22 SYSTEM
  1406.  
  1407.      The SYSTEM command is used to send a command to MSDOS.
  1408.  
  1409.  
  1410.      For  example "SYS L:" will set the L: drive as  the  current 
  1411. default  drive. If there is not enough memory available  for  the 
  1412. system command to be executed an error message is displayed.  The 
  1413. SYS  command will not work on floppy disk systems unless the  file 
  1414. "COMMAND.COM"  is  present  on the floppy disk  with  the  IMDISP 
  1415. program.
  1416.  
  1417. 4.5.23 TEXT
  1418.  
  1419. The text command can be used to display a string of text on the 
  1420. screen.  The text string can be entered on the command line,
  1421. enclosed 
  1422. in apostraphies or quotes (e. g., TEXT `This is a text string'). 
  1423.  
  1424. If the text string is not entered on the command line the program
  1425. will 
  1426. prompt for the string to be displayed.  
  1427.  
  1428. Once the command is issued and the text string entered the program
  1429. is 
  1430. placed in CURSOR mode so that the display position can be selected. 
  1431.  
  1432. This is done by using the arrow keys to move the cursor to the
  1433. desired 
  1434. location.  After the position is selected, the user types a period
  1435. (.) 
  1436. or carriage return and the text will be written on the display
  1437. screen.
  1438.  
  1439. The TEXT command has one argument and two optional keywords.
  1440.  
  1441.       LINe       The line number to position the text at.
  1442.       SAMple     The sample number to position the text at.
  1443.  
  1444.       'text...'  The text string to be printed, enclosed in 
  1445.                  quotes or apostraphies.
  1446.  
  1447. The  text  command  writes  over  image  data  in the display and 
  1448. refresh buffer, thus the underlying portion of the image is lost.
  1449.  
  1450. 4.5.24 TYPE
  1451.  
  1452.      The TYPE command is used to type the contents of a text file 
  1453. on the display screen, using the standard MSDOS type command.
  1454.  
  1455.      Its argument is passed to MSDOS for execution. At the end of 
  1456. the type operation the screen will display "Type carriage  return 
  1457. to  continue:" which will return to the IMDISP command  mode.  If 
  1458. there is not enough memory available for the system command to be 
  1459. executed an error message is displayed.
  1460.  
  1461. 4.6 OTHER UTILITY PROGRAMS
  1462.  
  1463.      There  are  several utility programs also  provided  on  the 
  1464. distribution  disk. (Note: these are not available on the floppy
  1465. disk).
  1466.  
  1467. 4.6.1 COPIM
  1468.  
  1469.      (Not available on floppy disk; only on CD-ROM)
  1470.  
  1471.  
  1472.                            Chapter 5
  1473.  
  1474.  
  1475.                         COMMAND SUMMARY
  1476.  
  1477.  
  1478.      Within this command summary listing, brackets ([])  indicate 
  1479. optional  parameters or keywords. Filename is the name of a  file 
  1480. in the current directory or a fully qualified filename which  can 
  1481. include  drive  letter and pathname. Directory name is  an  MSDOS 
  1482. directory   path   specification,  a  valid  directory   mask   a 
  1483. specification  containing wild card characters (*, ?)  per  MSDOS 
  1484. rules  for wildcard use in the DIRECTORY command. The symbol  "n" 
  1485. is used to indicate an integer value.
  1486.  
  1487.     driveletter:
  1488.     BATCH        [filenamel
  1489.     BROWSE       [directory mask] [SIZ n] [SUB n] [NOLabel]
  1490.     CD           [directory name]  [..]
  1491.     CURSOR
  1492.     DIRECTORY    [directory mask]  [/w]
  1493.     DISPLAY      [SUB n] [SL n] [SS n]  [NL n] [NS n]  [BP n] 
  1494.                  [CENT] [DSL n] [DSS n]
  1495.     ERASE
  1496.     EXIT
  1497.     FILE         [filename] ["CD:mm:ss:bb"]
  1498.     HELP         [command name]
  1499.     HISTOGRAM    [SUB n] [SL n] [SS n] [NL n] [NS n] [BP n] [CENT]
  1500.     LABEL
  1501.     MENU         [filename]
  1502.     OVERLAY      [MAXLAT n] [MAXLON n] [MINLAT n] [MINLON n]
  1503. [LEGend]
  1504.     PALETTE      [EDIT n] [PS n]  [LOAD filename] [SAVE filename]
  1505.     PROFILE
  1506.     QUIT
  1507.     REFRESH
  1508.     SAVE         filename [SL n] [SS n] [NL n] [NS n] [BP n]
  1509.     SET          [DNLO n] [DNHI n] [BROwse filename]
  1510.     STRETCH      [LO n] [HI n]
  1511.     SYSTEM       [MSDOS command]
  1512.     TEXT         [LINe n] [SAMple n] "text" or 'text'
  1513.     TYPE         filename
  1514.  
  1515.